home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group96a.txt / 000084_icon-group-sender _Mon Apr 15 15:44:01 1996.msg < prev    next >
Internet Message Format  |  1996-09-05  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 15 Apr 1996 12:26:58 MST
  2. Message-Id: <317260B1.7F93@tees.ac.uk>
  3. Date: Mon, 15 Apr 1996 15:44:01 +0100
  4. From: Hamish Lawson <H.Lawson@tees.ac.uk>
  5. Organization: University of Teesside, School of Computing and Maths
  6. X-Mailer: Mozilla 2.01Gold (Win95; I)
  7. Mime-Version: 1.0
  8. To: icon-group@cs.arizona.edu
  9. Subject: Making a list out of a generated sequence
  10. References: <s16ce499.081@wise.net>
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14. Status: O
  15.  
  16. Is there an easy way to make a list out of a generated sequence? I tried
  17. enclosing the generator sequence in square brackets, as below, but it
  18. doesn't appear to work.
  19.  
  20.    every write(sort([!"string"]))
  21.  
  22. Am I obliged to write a loop that appends each item of the generated
  23. sequence to a list?:
  24.  
  25.    tempList := list()
  26.    every tempList |||:= [!"string"]
  27.    every write(!sort(tempList))
  28.  
  29. If so, it would seem to me to be a curious lack of symmetry that the
  30. language provides the ! operator to generate elements of a list, but no
  31. corresponding convenient mechanism for collecting into a list a
  32. generated sequence of values.
  33.  
  34. | Hamish Lawson, School of Computing and Mathematics,
  35. | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
  36. | Tel: +44 1642 212695  Fax: +44 1642 342604
  37. | E-mail: H.Lawson@tees.ac.uk
  38.